package jk.framework.spring.security;

import java.util.HashSet;
import java.util.Set;

/**
 * SpringSecurity基础权限
 * @author cuichao
 */
public class BaseAccess {

    public static final String denyAll = "denyAll";

    public static final String permitAll = "permitAll";

    public static final String authenticated = "authenticated";

    public static final String fullyAuthenticated = "fullyAuthenticated";

    private static final Set<String> baseAccesses;

    static {
        baseAccesses = new HashSet<>();
        baseAccesses.add(denyAll);
        baseAccesses.add(permitAll);
        baseAccesses.add(authenticated);
        baseAccesses.add(fullyAuthenticated);
    }

    /**
     * 是否基础权限
     * @return
     */
    public static boolean hasBaseAccess(String access){
        return baseAccesses.contains(access);
    }
}
